home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.1 / card_23030.txt < prev    next >
Text File  |  1989-02-26  |  1KB  |  43 lines

  1. -- card: 23030 from stack: in.1
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 2202
  5. -- name: daysBetweenDates
  6. ----- HyperTalk script -----
  7. function DaysBetweenDates startDate, endDate
  8. convert startDate to seconds
  9. convert endDate to seconds
  10. return ((endDate - startDate)/(60*60*24))
  11. end daysBetweenDates
  12.  
  13.  
  14.  
  15. -- part contents for background part 10
  16. ----- text -----
  17. 6
  18.  
  19. -- part contents for background part 3
  20. ----- text -----
  21. daysBetweenDates
  22.  
  23. -- part contents for background part 2
  24. ----- text -----
  25.  --
  26.   -- subtracts endDate from startDate and returns days
  27.   -- note same days return 0
  28.   -- The dates should be in the form ("January 11,1987") or ("1/11/87")
  29.   -- The function call will look like this:
  30.   -- DaysBetweenDates("January 11, 1987","March 15, 1987") or
  31.   -- DaysBetweenDates("1/11/87","3/15/87")
  32.   --
  33.  
  34. function DaysBetweenDates startDate, endDate
  35.   convert startDate to seconds
  36.   convert endDate to seconds
  37.   return ((endDate - startDate)/(60*60*24))
  38. end daysBetweenDates
  39.  
  40.   --
  41.   -- Original function provided 12/87 by Dallas E. Weaver, Ph.D.
  42.   -- Modified 12/87 by Steve Drazga
  43.   --